package com.zhang.作业;

public class Rectangle {
    private double  chang;
    private double kuan;

    public Rectangle() {
    }

    public Rectangle(int chang, int kuan) {
        this.chang = chang;
        this.kuan = kuan;
    }

    public double getArea(){//面积
        return chang*kuan;
    }
    public double getPerimeter(){//周长
        return (chang+kuan)*2;
    }
    public void getInfo(){
        System.out.println("长："+getChang()+"宽："+getKuan()+"面积："+getArea()+"周长："+getPerimeter());
    }


    public double  getChang() {
        return chang;
    }

    public void setChang(double chang) {
        this.chang = chang;
    }

    public double  getKuan() {
        return kuan;
    }

    public void setKuan(double kuan) {
        this.kuan = kuan;
    }
}
